<%
	/**
	 *  login 系统登录页
	 * 
	 * @author  李荣华
	 * @version v1.0
	 * @date    2017-12-31
	 * @since   JDK1.6
	 */
%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="at" uri="http://www.jketing.com/at"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>系统登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta content="no-cache" http-equiv="Pragma" />
<meta content="no-cache" http-equiv="Cache-Control" />
<meta content="0" http-equiv="Expires" />
<meta name="GENERATOR" content="MSHTML 8.00.6001.18854" />
<link rel="stylesheet" type="text/css" href="<at:url css="login.css"/>" />
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery.js"></script>
<script type="text/javascript" src="<at:url js="login.js"/>"></script>
<script type="text/javascript">
		$(document).ready(function(){
			function keyDown(){
				if(event.keyCode==13){
				     login();
					}
			}
			document.onkeydown=keyDown;
			if (window != top) 
				top.location.href = location.href; 
		});
		
		function changeCodeImge(){
			document.all("codeImage").src = "index!getCodeImage.action?r=" + Math.random();
		}
		
		function login(){
			document.getElementById("loginForm").submit();
		}
		
		/**
		  * 跳转到密码找回页面
		  */
		function findPwd(){						
			var user = document.getElementById("yh").value;
			startRequest("<%=request.getContextPath()%>/Sys/UserSafe!findPwd", opHandler,{"user":user});
		}
		
		function opHandler(data, textStatus) {
			if(data=="NoUser"){
				alert("请输入要找回密码的用户名!");
			}
			if(data=="NoProtect"){
				alert("没有设置密保问题!");
			}				
			if(data=="ToFindPwd"){					
				var user = document.getElementById("yh").value;
				setTimeout(function(){
				    window.location.href = "<%=request.getContextPath()%>/Sys/UserSafe!toPsw?user=" + user;
				}, 0);
			}
		}
	
		function register() {
			setTimeout(function(){			
			    window.location.href = "index!register";		    
			},0);
		}
</script>
</head>
<body onLoad="MM_preloadImages('<at:url image="2.png"/>')">
	<form id="loginForm" name="loginForm" method="post" action="${pageContext.request.contextPath}/common/login">
		<table width="100%" height="100%" align="center"  border="0" style="position:absolute;top:50;" cellspacing="0" cellpadding="0">
			<tr>
				<td align="center" valign="middle">
					<table width="100%"	align="center" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td valign="middle">
								<div class="tu" id="tu"></div>
							</td>
						</tr>
						<tr>
							<td height="80" align="center" valign="middle" class="tiao">
								<table width="720" height="80" border="0" cellspacing="0"
									cellpadding="0">
									<tr>
										<td height="18">&nbsp;</td>
										<td rowspan="3">
												<table width="590" border="0" cellspacing="0"
													cellpadding="0">
													<tr>
														<td height="18" colspan="4">&nbsp;</td>
														<td rowspan="3" align="left" valign="middle">
															<table width="80" border="0" cellspacing="0" cellpadding="0">
																<tr>
																	<td width="80" height="80">
																	<a href="javascript:void(0)"
																		onclick="login();" 
																		onMouseOut="MM_swapImgRestore()"
																		onMouseOver="MM_swapImage('Image1','','<at:url image="2.png"/>',1)">
																		<img src="<at:url image="1.png"/>" name="Image1" width="80" height="80" border="0"/>
																	</a>
																	</td>
																	<td width="80" height="80">
																	<a href="javascript:void(0)"
																		onclick="register();" 																		
																		onMouseOver="MM_swapImage('Image1','','<at:url image="4.png"/>',1)">
																		<img src="<at:url image="3.png"/>" name="Image1" width="80" height="80" border="0"/>
																	</a>
																	</td>																	
																</tr>
															</table>
														</td>
													</tr>
													<tr>
														<td width="60" height="39" align="center" class="font_1">
															账&nbsp;&nbsp;&nbsp;&nbsp;号：
														</td>
														<td width="165" align="left" valign="middle">
															<input name="loginName" type="text" value="${loginName}" class="biaodan" id="yh" size="20" maxlength="50"/>
														</td>
														<td width="50" align="center" class="font_1">
															密&nbsp;&nbsp;&nbsp;&nbsp;码：
														</td>
														<td width="165" align="left" valign="middle">
															<input name="password" type="password" value="${password}" class="biaodan" id="password" size="20" maxlength="50"/>
														</td>
													</tr>
													<tr>
														<td height="22" colspan="4">&nbsp;</td>
													</tr>
												</table>
											</td>
									</tr>
									<tr>
										<td height="39" id="left_1">&nbsp;</td>
									</tr>
									<tr>
										<td height="22">&nbsp;</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td height="30" align="center">
								<font color="red" size="4">${loginInfo}</font>&nbsp;								
							</td>							
						</tr>
						<tr>							
							<td height="20" align="center">								
								<a href="###" onclick="findPwd();">找回密码</a>
							</td>
						</tr>
						<tr>
							<td align="center" valign="middle"><table width="255"
									border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td align="center" class="font_2">版权所有©云南华讯信息科技有限公司 2012</td>
									</tr>
									<tr>
										<td align="center" valign="middle"><a
											href="http://www.huaxing.com/" target="_blank">www.huaxing.com</a>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</form>
</body>
</html>
